<div class="cl pd-5 bg-1 bk-gray"> 
	<span class="r">共有数据：<strong>{$count}</strong> 条</span>
</div>
<div style="height: 400px;">
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr class="text-c">
				<th width="25">ID</th>
				<th>房间名称</th>
				<th>业主姓名</th>
				<th>费项名称</th>
				<th>应缴费用</th>
				<th>拖欠时间(天)</th>
				<th>滞纳金</th>
				<th>总计</th>
				<th>费用日期</th>
				<th>缴费期限</th>
				<th>账单生成日期</th>
				<th>账单状态</th>
				<th width="70">操作</th>
			</tr>
		</thead>
		<tbody>
			<?php if(is_array($list) && count($list)){ ?>
				<?php foreach($list as $k=>$ls){ $rowline = count($ls['list']); ?>
					<?php foreach($ls['list'] as $kk=>$lls){ ?>
					<tr class="text-c">
						<?php if($kk == 0){ ?>
						<td width="40" rowspan="{$rowline}"><?php echo ($page-1)*C('PAGE_SIZE')+($k+1); ?></td>
						<td rowspan="{$rowline}">{$ls['room_title']}</td>
						<td rowspan="{$rowline}">{$ls['owner_name']}</td>
						<?php } ?>
						<td>{$lls['costtype_title']}</td>
						<td><p class="c-primary">{$lls['costlog_point']}</p></td>
						<td>{$lls['costlog_latefee_day']}</td>
						<td><p class="c-error">{$lls['costlog_latefee_account']}</p></td>
						<td><p class="c-success"><?php echo sprintf("%.2f", $lls['costlog_point'] + $lls['costlog_latefee_account']); ?></p></td>
						<td>{$lls['costlog_times']}</td>
						<td>{$lls['costlog_lasttime']|date="Y-m-d", ###}</td>
						<td>{$lls['costlog_createtime']|date="Y-m-d", ###}</td>
						<td>{$lls['costlog_status'] ? '已缴' : '未缴'}</td>
						<?php if($kk == 0){ ?>
						<td class="f-14" rowspan="{$rowline}">
							<a title="详情" href="javascript:;" style="text-decoration:none;" class="btninfo" _roomid="{$ls['room_id']}"><i class="Hui-iconfont">&#xe709;</i></a> 
						</td>
						<?php } ?>
					</tr>
					<?php } ?>
				<?php }?>
			<?php }else{ ?>
			<tr class="text-c">
				<td colspan="19" >暂无数据...</td>
			</tr>
			<?php } ?>
		</tbody>
	</table>
</div>
<script>
	$(document).ready(function(){
		$(".btninfo").on('click', function(){
			var roomid = $(this).attr('_roomid');
			var load = layer.load(2);
			//异步请求数据
			$.get('ajaxpay.html', {roomid: roomid, times: $("#stime").val()}, function(data){
				layer.close(load);
				if(data.errCode/1){
					var info = data.info;
					$("#roomid").val(info.room_id);
					$(".roomtitle").html(info.room_title);
					$(".ownername").html(info.owner_name);
					$(".counts").html(info.total);
					$(".costlog_point").html(info.costlog_point);
					$(".lastfree").html(info.latefee_account);
					$(".account").html(info.account);
					
					$(".codeView").show();
				}else{
					layer.msg('未搜索到数据', {icon: 0, time: {$Think.config.PROMPT_TIME}});
				}
			});
		});
	});
</script>
<!--page-->
<include file="Common/page" />